class DisruptorBurnDamage extends Actor;

var class<DamageType> DamageType;

#EXEC OBJ LOAD FILE=../Sounds/GeneralAmbience.uax

simulated function PostBeginPlay()
{
	SetTimer( 0.2, true );
}

simulated function Timer()
{
	local int i;

	if ( Pawn(Base) != None && Pawn(Base).Health > 0 )
	{
		//PlaySound(sound'GeneralAmbience.firefx1',,220);
		if ( !Base.IsA('Vehicle') )
			Base.TakeDamage(2, Instigator, Location, vect(0,0,0), DamageType);

		if ( Base.IsA('Vehicle') && Vehicle(Base).Driver != None && Instigator != None){
//			Vehicle(Base).Driver.SetDelayedDamageInstigatorController(Instigator.Controller);
			Vehicle(Base).Driver.TakeDamage(15, Instigator, Location, vect(0,0,0), DamageType);}

		if ( Base.IsA('ONSVehicle') && Vehicle(Base).Driver != None && Instigator != None){

			for (i=0; i<ONSVehicle(Base).WeaponPawns.length; i++)
				if ( ONSVehicle(Base).WeaponPawns[i].Driver != None ){
					//ONSVehicle(Base).WeaponPawns[i].Driver.SetDelayedDamageInstigatorController(Instigator.Controller);
					ONSVehicle(Base).WeaponPawns[i].Driver.TakeDamage(15, Instigator, Location, vect(0,0,0), DamageType);}}

		if ( Base.IsA('Vehicle') && Vehicle(Base).bShowDamageOverlay == False){
        	    Vehicle(Base).SetOverlayMaterial( DamageType.default.DamageOverlayMaterial, DamageType.default.DamageOverlayTime, false );

			for (i=0; i<ONSVehicle(Base).WeaponPawns.length; i++)
			ONSVehicle(Base).WeaponPawns[i].SetOverlayMaterial( DamageType.default.DamageOverlayMaterial, DamageType.default.DamageOverlayTime, false );}

	}
	else
		Destroy();
}

defaultproperties
{
     DamageType=Class'Taskforces.DisruptorFlameDamType'
     bHidden=True
     LifeSpan=2.000000
}
